package com.mc.moring.main.adapter;

import android.text.TextUtils;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mc.moring.R;
import com.mc.moring.bean.GetFullUserBean;


public class InfoAdapter extends BaseQuickAdapter<GetFullUserBean.cInfoBean, BaseViewHolder> {

    public InfoAdapter() {
        super(R.layout.item_emergency_info);
    }

    @Override
    protected void convert(BaseViewHolder helper, GetFullUserBean.cInfoBean item) {
        helper.setText(R.id.et_emergency_name, item.getName());
        helper.setText(R.id.et_telephone_number, item.getMobile());
        TextView relationships = helper.getView(R.id.et_relationship_kinship);
        if (!TextUtils.isEmpty(item.getRelation())) {
            if (item.getRelation().equals("A")) {
                relationships.setText("Soltero(a)");
            } else if (item.getRelation().equals("B")) {
                relationships.setText("Casado(a)");
            } else if (item.getRelation().equals("C")) {
                relationships.setText("Viudo(a)");
            } else if (item.getRelation().equals("D")) {
                relationships.setText("Separado(a)");
            } else if (item.getRelation().equals("E")) {
                relationships.setText("Divorciado(a)");
            } else {
                relationships.setText("Pareja de hecho(a)");
            }
        }
    }

}
